import 'package:flutter/material.dart';

mixin utilsWidget {
  //加载更多时显示的组件,给用户提示
  static Widget loadingWidget(bool isLoading, bool noMore) {
    if (isLoading) {
      return null;
    }
    if (noMore) {
      return Center(
        child: Container(padding: EdgeInsets.all(10.0), child: Text("没有更多了。")),
      );
    }
    return Center(
      child: Container(
        padding: EdgeInsets.all(10.0),
        child: SizedBox(
            height: 30,
            width: 30,
            child: CircularProgressIndicator(
              strokeWidth: 2.5,
            )),
      ),
    );
  }
}
